import { Component, OnInit, OnDestroy } from '@angular/core';

@Component({
  selector: 'app-child-two',
  templateUrl: './child-two.component.html',
  styleUrls: ['./child-two.component.css']
})
export class ChildTwoComponent implements OnInit, OnDestroy {

  constructor() { }

  ngOnInit() {
  }
  ngOnDestroy(): void {       // OnDestroy一般用于销毁事件流或者定时器
    console.log("child2组件被销毁");
  }
}
